package com.example.demo;

import com.example.demo.service.listener.ChatMessageRedisListener;
import com.example.demo.util.SpringContextUtil;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class DemoApplication {

    public static void main(String[] args) {
        SpringApplication.run(DemoApplication.class, args);


        ChatMessageRedisListener chatMessageRedisListener = SpringContextUtil.getBean(ChatMessageRedisListener.class);
        new Thread(() -> chatMessageRedisListener.consumeMessageQueue()).start();
    }

}
